package com.cs.widgetvp.fragment;

import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.cs.base.BaseFragment;
import com.cs.base.router.RouterActivityPath;
import com.cs.base.vm.BaseViewModel;
import com.cs.widgetvp.databinding.FragmentCustomerBinding;

/**
 * @ClassName: CustomerFragment
 * @Date: 2021/6/17
 * @Author: CS
 * @Description: 自选功能
 */
public class CustomerFragment extends BaseFragment<BaseViewModel, FragmentCustomerBinding> {

    @Override
    protected FragmentCustomerBinding getViewBinding(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) {
        return FragmentCustomerBinding.inflate(inflater,container, false);
    }

    @Override
    protected void initView() {
        binding.buttonNext1.setOnClickListener(this);
        binding.buttonNext2.setOnClickListener(this);
        binding.buttonNext3.setOnClickListener(this);
    }

    @Override
    protected void initData() {

    }


    @Override
    public void onClick(View v) {
        String url="";
        if(v==binding.buttonNext1){
            router(RouterActivityPath.RV.HOME_RV).withString("state","888").navigation();

            //url="https://m.tebon.com.cn/appshare/hxApp4.0.html#/tebonjumpurl=/integration/integration-index.html&&tztadjustnever=1&&needLogin=1";
            //url="https://m.tebon.com.cn/appshare/hxApp4.0.html#/tebonjumpurl=%2Fintegration%2Fintegration-index.html%26%26tztadjustnever%3D1&&needLogin=1";

            //url="https://testwealth.tebon.com.cn/h5_vue/activity/jinnangmiaoji/index.html#/";
            url="https://m.tebon.com.cn/appshare/hxApp4.0.html#/tebonjumpurl=%2Fh5_third%2FTHS%2Fadviser%2Findex.html%26%26tzthiddentitle%3D1%26%26tztadjustnever%3D1";
//            final Intent intent = new Intent();
//            intent.setAction(Intent.ACTION_VIEW);
//            intent.setData(Uri.parse(url));
//            startActivity(intent);
        }else if(v==binding.buttonNext2){
            //url="https://m.tebon.com.cn/appshare/hxApp4.0.html#/tebonjumpurl=/h5_vue/tbmall/fundcombine/index.html#/root/mall_strategy?combineSerial=2020062200000000019&&tztadjustnever=1&&needLogin=2";
            url="https://m.tebon.com.cn/appshare/hxApp4.0.html#/tebonjumpurl=%2Fh5_vue%2Ftbmall%2Ffundcombine%2Findex.html%23%2Froot%2Fmall_strategy%3FcombineSerial%3D2020062200000000019%26%26tztadjustnever%3D1&&needLogin=2";
            router(RouterActivityPath.Main.PAGER_PHOTO).withString("state","888").navigation();

        }else if(v==binding.buttonNext3){
            Log.e("CustomerFragment","buttonNextit");

//            Intent it = new Intent("cailueapp.test.notify");
//            it.setComponent(new ComponentName("com.whrhkj.cailueapp.jpush",
//                    "com.whrhkj.cailueapp.jpush.TestMessageReceive"));
//            getActivity().sendBroadcast(it);


//            Intent intent = new Intent(getContext(),WebActivity.class);
//            startActivity(intent);

        }

    }
}